package com.starlink.client.ras.request;

import com.starlink.client.ras.response.WrapAuditListResponse;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
public class GoodsBindingRequest extends RasBaseRequest implements Serializable {
    private static final long serialVersionUID = -6662597103536008406L;
    /**
     * {
     *     "abstring": "a",
     *     "abstringList": [
     *         "b",
     *         "c",
     *         "d"
     *     ],
     *     "wrap": {
     *         "wrapType": "一级包装 (装入商品)",
     *         "wrapTypeName": "云南丽容早餐箱",
     *         "wrapSpecs": "2件/箱",
     *         "shopId": "任意装箱",
     *         "attributionId": 120,
     *         "attributionName": "云南普瑞生物制药（集团）有限公司",
     *         "belongFlag": 2,
     *         "platformId": 63,
     *         "platformName": "生物多样性大健康产业发展(云南)智能监管平台",
     *         "companyId": 120,
     *         "companyName": "云南普瑞生物制药（集团）有限公司",
     *         "wrapName": "云南丽容早餐箱",
     *         "list": [
     *
     *         ],
     *         "businessId": -1,
     *         "messageId": -1,
     *         "id": 271,
     *         "wrapSerial": "2024030802041303"
     *     }
     * }
     */

    /**
     * 书包上贴的那个码
     */
    private String abstring;
    /**
     * 书包里面装的书上面那些全码值
     */
    private List<String> abstringList;
    /**
     * 通过查询外包装商品进行数据的组装
     */
    private WrapDTO wrap;

    @Data
    @NoArgsConstructor
    public static class WrapDTO implements Serializable {
        private static final long serialVersionUID = -1036151010696523787L;
        private String wrapType;
        private String wrapTypeName;
        private String wrapSpecs;
        private String shopId;
        private Integer attributionId;
        private String attributionName;
        private Integer belongFlag;
        private Integer platformId;
        private String platformName;
        private Integer companyId;
        private String companyName;
        private String wrapName;
        private List<?> list;
        private Integer id;
        private String wrapSerial;

        public WrapDTO(WrapAuditListResponse.RecordsDTO record) {
            this.wrapType = record.getWrapType();
            this.wrapTypeName = record.getWrapTypeName();
            this.wrapSpecs = record.getWrapSpecs();
            this.shopId = record.getShopId();
            this.attributionId = record.getAttributionId();
            this.attributionName = record.getAttributionName();
            this.belongFlag = record.getBelongFlag();
            this.platformId = record.getPlatformId();
            this.platformName = record.getPlatformName();
            this.companyId = record.getCompanyId();
            this.companyName = record.getCompanyName();
            this.wrapName = record.getWrapName();
            this.list = record.getList();
            this.id = record.getId();
            this.wrapSerial = record.getWrapSerial();
        }
    }

}
